﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Apq
{
	/// <summary>
	/// 表示C#编程中某个对象具有某个成员
	/// </summary>
	public class CSMember : IEquatable<CSMember>//可以进行相等比较
	//, IComparer<CSMember>//大小比较器
	//,IComparable<CSMember>//可以进行大小比较
	{
		public CSMember(object Obj = null, string MemberName = "")
		{
			_Obj = Obj;
			_MemberName = MemberName;
		}

		private object _Obj;
		/// <summary>
		/// 获取或设置对象
		/// </summary>
		public object Obj
		{
			set { _Obj = value; }
			get { return _Obj; }
		}
		private string _MemberName;
		/// <summary>
		/// 获取或设置成员名
		/// </summary>
		public string MemberName
		{
			set { _MemberName = value; }
			get { return _MemberName; }
		}

		#region IEquatable<CSMember> 成员

		/// <summary>
		/// 相等比较
		/// </summary>
		public bool Equals(CSMember other)
		{
			return this.Obj.Equals(other.Obj) && this.MemberName.Equals(other.MemberName);
		}

		#endregion
	}
}
